/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mindwave.theoracle;

/**
 *
 * @author MarcoJ
 */
public enum Figure {

    Spento(0),
    Quadrato(2),
    Cerchio(1),
    Triangolo(4),
    Esagono(3);
    private int code;

    private Figure(int code) {
        this.code = code;
    }

    public int getCode() {
        return this.code;
    }

    public static String getName(int code) {

        switch (code) {

            case 0:
                return "Spento";
            case 1:
                return "Cerchio";
            case 2:
                return "Quadrato";
            case 3:
                return "Esagono";
            case 4:
                return "Triangolo";
            default:
                return null;

        }
        
    }

    public static Figure getFigure(int code) {

        switch (code) {

            case 0:
                return Figure.Spento;
            case 1:
                return Figure.Cerchio;
            case 2:
                return Figure.Quadrato;
            case 3:
                return Figure.Esagono;
            case 4:
                return Figure.Triangolo;
            default:
                return null;

        }

    }
}
